/*
*================================================================================
*	Plik: f_sbic.c
*	Created on: Jun 5, 2011
*--------------------------------------------------------------------------------
*	Autorzy: Piotr Zdunek, Mateusz Słowikowski, Krzysztof Wiąckowski
*	Projekt: Model mikrokontrolera AVR
*	Kompilator: avr-gcc-4.3.5
*	Doc: doxygen 1.4.3
*--------------------------------------------------------------------------------
*	Zawiera: 
*--------------------------------------------------------------------------------
*	Komentarze:
*================================================================================
*/

/*! \file f_sbic.c
 * \brief Plik opisujący funkcję SBIC
 */

#include "types.h"
#include "mem_abs.h"

void F_SBIC() {
//
#ifndef  DEBUG_MODE
	printf("Function SBIC\n");
#endif

	uint8_t A = (((getMEMC(getPC()) & 0x00FF) & 0b11111000) >> 3);
	uint8_t b = (((getMEMC(getPC()) & 0x00FF) & 0b00000111));
	uint8_t k_temp = 2; //ewentualny skok

	if( GetRegisterBitStatus(getMEMD(A),b) == 0 ){
		incPC_k(k_temp);
	}else {
		incPC();
	}
}
